// 封装各个模块的请求接口方法

// 导入请求方式模块
import request from './request'

// 导入mock模拟数据
// import mock from './requestMock'
// 请求mock模拟数据(获取路由)
// export const getRoutes = () => mock.get('/system/routes/get')

// 封装一个登录的请求接口方法
export const login = (data) => request.login('/login/checklogin', data)

// 封装一个退出登录的请求接口方法
export const logout = () => request.get('/login/logout')

// 获取后台管理员列表
export const getSystemUser = (params) => request.get('/system/user/get', params)

// 添加后台管理员账号
export const addSystemUser = (data) => request.post('/system/user/add', data)

// 更新后台管理员账号
export const updateSystemUser = (data) => request.post('/system/user/update', data)

// 删除后台管理员账号
export const removeSystemUser = (params) => request.get('/system/user/delete', params)

// 根据uid获取账号信息
export const getUserById = (params) => request.get('/system/user/getUserByUid', params)

// 搜索账号信息
export const searchUser = (params) => request.get('/system/user/search', params)

/*------------------------------------------------------------------*/

// 获取所有角色列表
export const getRoleList = () => request.get('/system/role/getAll')

// 获取指定id角色
export const getRoleById = (params) => request.get('/system/role/get', params)

// 删除角色
export const removeRole = (params) => request.get('/system/role/delete', params)

// 添加角色
export const addRole = (data) => request.post('/system/role/add', data)

// 添加角色
export const updateRole = (data) => request.post('/system/role/update', data)

/*------------------------------------------------------------------*/

// 获取权限列表
export const getScopeAll = () => request.get('/system/scope/getAll')

// 获取指定id权限
export const getScopeById = (params) => request.get('/system/scope/get', params)

// 更新权限
export const updateScope = (data) => request.post('/system/scope/update', data)

/*------------------------------------------------------------------*/

// 获取商品分类列表
export const getGoodsCategory = () => request.get('/goods/category/get')

// 删除商品分类
export const removeGoodsCategory = (params) => request.get('/goods/category/delete', params)

// 添加商品分类
export const addGoodsCategory = (data) => request.post('/goods/category/add', data)

// 更新商品分类
export const updateGoodsCategory = (data) => request.post('/goods/category/add', data)

/*------------------------------------------------------------------*/

// 获取商品属性列表
export const getGoodsAttr = () => request.get('/goods/attr/get')

// 删除商品属性
export const removeGoodsAttr = (params) => request.get('/goods/attr/delete', params)

// 添加商品属性
export const addGoodsAttr = (data) => request.post('/goods/attr/add', data)

// 更新商品属性
export const updateGoodsAttr = (data) => request.post('/goods/attr/update', data)

/*------------------------------------------------------------------*/

// 获取路由
export const getRouteList = () => request.get('/system/route/get')

// 添加路由
export const addRoute = (data) => request.post('/system/route/add', data)

// 删除路由
export const removeRoute = () => request.get('/system/route/delete')

// 更新路由
export const updateRoute = (data) => request.post('/system/route/update', data)
